/******************************************************************************
* SVN­Version­Information:
* ­­­­­­­­­­­­­­­­­­­­­­­­---------------------
* $LastChangedRevision: 6 $
* $LastChangedBy: c.a.duevel $
* $LastChangedDate: 2009-08-26 15:12:37 +0000 (Wed, 26 Aug 2009) $
* $HeadURL: http://robofight.googlecode.com/svn/trunk/ClientJavaFX/src/de/hft_stuttgart/robofight/client/javafx/util/MessageBox.fx $
******************************************************************************/

package de.hft_stuttgart.robofight.client.javafx.util;



import javafx.ext.swing.SwingButton;
import javafx.scene.Scene;
import javafx.scene.paint.Color;
import javafx.scene.text.Text;
import javafx.stage.Stage;

import de.hft_stuttgart.robofight.client.javafx.Constants;


/**
 * @author ralf.dauenhauer@gmx.de, michael.rieker@web.de
 */
 public class MessageBox  {
    public var msg : String;
    public var title : String = "Warning";
    public var okVisible : Boolean = true;

    init {
        stage.toFront();
    }


    var stage : Stage = Stage {
        title: title
        width: 500
        height: 100
        opacity: 0.9
        iconified: false
        resizable: false
        scene: Scene {
        fill : Color.BLACK;
        content: [
                Text {
                    font : Constants.FONT_TEXTFIELD
                    fill : Color.WHITE
                    x: 10, y: 20
                    content: msg
                },
                SwingButton {
                    font : Constants.FONT_TEXTFIELD
                    text : "OK"
                    translateX : 225
                    translateY : 30
                    width : 50
                    height: 30
                    action: function(){
                        stage.close();
                    }
                    visible : bind okVisible
                 }
            ]
        }
    }
 
}
